﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using _4T.DAL;
using _4T.Data;

namespace _4T.BLL
{
    public class MedicalInfoBLL
    {
        private MedicalInfoDAL medicalDAL;
        protected MedicalInfoDAL MedicalDAL
        {
            get
            {
                if (medicalDAL == null)
                {
                    medicalDAL = new MedicalInfoDAL();
                }

                return medicalDAL;
            }
        }

        public MedicalInfoBLL() { }

        public MedicalInfo GetMedicalInfo(string profileCode)
        {
            CMS_ProfileInfo info = new ProfileInfoDAL().GetLastProfileInfoByProfileCode(profileCode);
            if (info != null)
            {
                return MedicalDAL.GetMedicalInfo(info.ProfileInfoCode);
            }
            return null;
        }

        public MedicalInfo GetMedicalInfoByProfileInfoCode(string profileInfoCode)
        {
            return MedicalDAL.GetMedicalInfo(profileInfoCode);
        }
    }
}